
<script type="text/javascript">
$(document).ready(function(){
  setTimeout(function () { test(); }, 500);
        function test(){
          $("table").addClass("table-bordered table-hover table-striped");
      }
    });
</script>
<script type="text/javascript">  
 function search(obj) {
        $('tr').hide().filter(":contains('" +($(obj).val()) + "')").show();
    }

</script>
<script type="text/javascript">
function new111(){
        $('tr').hide().filter(":contains('" +$('#cpsel').val() + "')").show().filter(":contains('已存在')").hide();
    }
</script>
<div class="row">
  <div class="col-md-2"> 
  <div style="position:fixed;" class="xs-hidden" >
    <div class="btn-group-vertical" style="width: 200px;">

      <button type="button" class="btn btn-default" onclick="$('tr').show()" value="yes">显示所有</button>
      <button type="button" class="btn btn-default" onclick="search(this)" value="不存在">只显示新增</button>
      <button type="button" class="btn btn-default" onclick="method5('store')"  >导出Excel</button>
    </div>
    <hr>
    <div>
    <label for="name">CP更新筛选</label>
    <select class="form-control" id="cpsel">
    <?php
        header("Content-type: text/html; charset=utf-8");
$con = mysql_connect("113.215.1.161","root","root");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
//code
mysql_select_db("mydb", $con);//选库
mysql_query("set names 'utf8'");
$result = mysql_query("SELECT distinct  CP FROM IPcheckTab");
while($row = mysql_fetch_array($result))
  {
    printf('<option value ="%s">%s</option>',$row['CP'],$row['CP']);
  }
mysql_close($con);
    ?>
    </select>
    <br>
    <button type="button" class="btn btn-default" onclick="new111()" value="yes">查询更新</button>
    </div>
    </div>
  </div>

  <div class="col-md-10">
<?php
header("Content-type: text/html; charset=utf-8");
$con = mysql_connect("113.215.1.161","root","root");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
//code
mysql_select_db("mydb", $con);//选库
mysql_query("set names 'utf8'");
$result = mysql_query("SELECT * FROM IPcheckTab ORDER BY CP");
echo "<table id='store' width='90%'>
<tr>
<th>IP</th>
<th>CP</th>
<th>域名</th>
<th>是否为新增</th>
</tr>";
while($row = mysql_fetch_array($result))
  {
  echo "<tr>";
  echo "<td>" . $row['IP'] . "</td>";
  echo "<td>" . $row['CP'] . "</td>";
  echo "<td>" . $row['domain'] . "</td>";
  echo "<td>" . $row['exist'] . "</td>";
  echo "</tr>";
  }
echo "</table>";

mysql_close($con);
?> 
  </div>
</div>

